﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace State
{
    public class Context
    {
        private IState state;

        public Context(IState state)
        {
            this.State = state;
        }

        public IState State {
            get { return this.state; }
            set { 
                this.state = value;
                Console.WriteLine( "State: " + this.state.GetType().Name );
            } 
        }

        public void Request()
        {
            this.state.Handle(this);
        }
    }
}
